import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:bruno/bruno.dart';
import 'package:search_people/page/dynamic/main/index.dart';
import 'package:search_people/page/home/main/view.dart';
import 'package:search_people/page/me/index.dart';
import 'package:search_people/page/report/index.dart';
import 'package:search_people/value/topcolors.dart';
import '../analysis/main/view.dart';
import 'logic.dart';

class Bottom_navigationPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final logic = Get.put(Bottom_navigationLogic());
    final state = Get.find<Bottom_navigationLogic>().state;
    return Obx(() => Scaffold(
        body: IndexedStack(
          index: state.currentIndex.value,
          children: [
            HomePage(),
            AnalysisPage(),
            DynamicPage(),
            ReportPage(),
            MePage(),
          ],
        ),
        bottomNavigationBar: BrnBottomTabBar(
          iconSize: 35.r,
          fixedColor: TopColors.main_color,
          currentIndex: state.currentIndex.value,
          onTap: (index) => logic.clickTab(index),
          isAnimation: false,
          // badgeColor: Colors.red,
          items: state.items,
        )));
  }
}
